<?=$header?>
<!--script src="<?=base_url();?>system/codepress/codepress.js" type="text/javascript"></script-->

<p>Current Theme: <b><?=$theme?></b><br />
<?
$files = directory_map('./themes/'.$theme.'/', true);
foreach ($files as $file){
	$ext = substr(strrchr($file, '.'), 1);
	if($ext == 'php' || $ext == 'css' || $ext == 'html'){
		echo '<a href="'.base_url().'theme/edit/'.$theme.'/'.$file.'">'.$file.'</a>, ';
	}
}

if($open_file == ''){
	$open_file = 'index.php';
}
$ext = substr(strrchr($open_file, '.'), 1);
?>
<br /><br />
<form action="<?=base_url();?>theme/edit2" method="post">
<input type="hidden" name="theme" value="<?=$theme?>" />
<input type="hidden" name="file" value="<?=$open_file?>" />
<textarea name="content" cols="90" rows="20" ><? echo read_file('./themes/'.$theme.'/'.$open_file); ?></textarea><br />
<input type="submit" name="submit" value="Edit File" />
</form>
</p>

<?=$footer?>

</body>
</html>